<!DOCTYPE html>
<html>
<head>
<title>编辑品牌</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>编辑品牌</h5>
            </div>
           <form id="inputForm" action="update" method="post">
           		<input type="hidden" name="id" value="#(brand.id)">
	            <div class="ibox-content">
	                <div class="form-horizontal clearfix">
	                    <div class="form-group">
                            <label class="col-sm-3 control-label">名称：</label>
                            <div class="col-sm-3">
                                <input class="form-control" type="text" name="name" value="#(brand.name)">
                            </div>
                        </div>
                        <div class="form-group">
                           <label class="col-sm-3 control-label">展示图片：</label>
                           <div class="col-sm-3" id="fileImage">
                                 #if(brand.image??)
                                 <img alt="" src="#(imageUrl(brand.image))" height="110"><input type="hidden" name="image" value="#(imageUrl(brand.image))"/>
                                 #end
                             </div>
                             <div class="col-sm-3">
                                 <a href="javascript:;" id="filePicker" class="btn btn-primary">选择文件</a>
                             </div>
                       </div>
                       <div class="form-group">
	                        <label class="col-sm-3 control-label">说明：</label>
	                        <div class="col-sm-3">
                                <textarea class="form-control" style="height: 100px;" name="remark">#(brand.remark)</textarea>
                            </div>
	                    </div>
	                </div>
	            </div>
	            <div class="modal-footer col-sm-3 col-sm-offset-2">
	                <button type="submit" class="btn btn-w-m btn-primary">确定</button>
	                <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
	            </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
function fileUploadCall(fromType,url){
	var html='<img alt="" src="'+url+'" height="110"><input type="hidden" name="image" value="'+url+'"/>';
	$("#fileImage").html(html);
}
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	var $filePicker = $("#filePicker");

    $filePicker.uploader();
    
    // 表单验证
    $inputForm.validate({
        rules: {
            name: "required"
        }
    });

});
</script>

